#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
const int N = 1e5 + 10;
int n;
LL a[N * 3];
int main()
{
    cin >> n;
    for (int i = 0; i < 3 * n; i++)
        cin >> a[i];

    sort(a, a + 3 * n);
    LL sum = 0;
    for (int i = 3 * n - 1; i > n; i -= 2)
    {
        sum += a[i - 1];
    }

    cout << sum << endl;
    return 0;
}